package com.lq.ecoldchain.ui.mymileage.ranking

import com.lq.ecoldchain.base.CommonLoadingViewModel
import com.lq.ecoldchain.ui.mymileage.details.MileageDetailViewModel
import org.kodein.di.Kodein
import org.kodein.di.android.support.AndroidLifecycleScope
import org.kodein.di.generic.bind
import org.kodein.di.generic.scoped
import org.kodein.di.generic.singleton

/*
*2019/1/5 0005  20:15
*function by lq
*/
val mileageRankingKodeinModule = Kodein.Module("Mileage_Ranking_Kodein_Module"){
   bind<MileageDetailViewModel>() with scoped(AndroidLifecycleScope).singleton {
       MileageDetailViewModel()
   }

    bind<MileageRankingDelegate>() with scoped(AndroidLifecycleScope).singleton {
        MileageRankingDelegate(
                viewModel = MileageRankingViewModel(),
                loadingViewModel =  CommonLoadingViewModel.instance(context)
        )
    }
}